/*
 * Timer.cpp
 *
 *  Created on: 27-12-2010
 *      Author: Przemek
 */

#include "utils/Timer.hpp"

Timer::Timer() :
	startTimeInMillis(0), endTimeInMillis(0)
{

}

void Timer::start()
{
	startTimeInMillis = endTimeInMillis = SDL_GetTicks();
}

void Timer::stop()
{
	endTimeInMillis = SDL_GetTicks();
}

float Timer::getSeconds()
{
	return getMiliseconds() / 1000.0f;
}

Uint32 Timer::getMiliseconds()
{
	return static_cast<Uint32> (endTimeInMillis - startTimeInMillis);
}
